package com.filetest;

import java.io.*;

public class BuZiFu {
    public static void main(String[] args) throws IOException {
        File f = new File("D:/demo5.txt");
        FileWriter writer = new FileWriter(f);
        BufferedWriter bufwriter = new BufferedWriter(writer);
        bufwriter.write("你好\nworld\nasdf\nasdf\nasdf");

        bufwriter.close();
        writer.close();


        FileReader reader = new FileReader(f);
        BufferedReader bufReader = new BufferedReader(reader);
        String l=bufReader.readLine();
        while (l!=null){
            System.out.println(l);
            l=bufReader.readLine();
        }

    }
}
